chore(ui,shared,localizations): Add confirmation step for <ConfigureSSO />#8531
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 1d874c3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
47bc219 to
07df12b
Compare
<ConfigureSSO /><ConfigureSSO />
e0aa425 to
3d00844
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR adds a composed Configure SSO confirmation UI (status badge, enable switch, domain link, SAML configuration details, and a destructive reset flow) and wires it as Flow.Part 'ssoConfirmation'. It introduces matching en-US localization keys and updates shared types (ProfileSectionId and localization shapes). UI primitives updated: Section now forwards a titleId/textId to its Text child, Switch accepts optional label and ARIA props and conditionally renders its caption, and FlowMetadata part literal was renamed. A changeset notes patch releases for affected packages. Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/ui/src/elements/Switch.tsx`:
- Around line 7-16: The Switch component currently allows omitting a visible
label and also omits any aria labeling, producing an unlabeled control; update
the component to enforce an accessible name by adding a runtime guard inside the
Switch function (the component that uses SwitchProps) that checks if props.label
is falsy AND both props['aria-label'] and props['aria-labelledby'] are falsy,
and if so emit a clear console.error (or throw) and return null (or throw) to
prevent rendering an unlabeled control; alternatively update SwitchProps to a
discriminated/union type that requires either label or one of
'aria-label'/'aria-labelledby' and add the runtime assertion to cover JS
consumers — reference SwitchProps, props.label, props['aria-label'],
props['aria-labelledby'], and the Switch component render logic to locate where
to add the check and error message.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 0a1f33e4-ee14-463f-9d11-5245c53daefb
📒 Files selected for processing (56)
.changeset/forty-cameras-guess.mdpackages/localizations/src/ar-SA.tspackages/localizations/src/be-BY.tspackages/localizations/src/bg-BG.tspackages/localizations/src/bn-IN.tspackages/localizations/src/ca-ES.tspackages/localizations/src/cs-CZ.tspackages/localizations/src/da-DK.tspackages/localizations/src/de-DE.tspackages/localizations/src/el-GR.tspackages/localizations/src/en-GB.tspackages/localizations/src/en-US.tspackages/localizations/src/es-CR.tspackages/localizations/src/es-ES.tspackages/localizations/src/es-MX.tspackages/localizations/src/es-UY.tspackages/localizations/src/fa-IR.tspackages/localizations/src/fi-FI.tspackages/localizations/src/fr-FR.tspackages/localizations/src/he-IL.tspackages/localizations/src/hi-IN.tspackages/localizations/src/hr-HR.tspackages/localizations/src/hu-HU.tspackages/localizations/src/id-ID.tspackages/localizations/src/is-IS.tspackages/localizations/src/it-IT.tspackages/localizations/src/ja-JP.tspackages/localizations/src/kk-KZ.tspackages/localizations/src/ko-KR.tspackages/localizations/src/mn-MN.tspackages/localizations/src/ms-MY.tspackages/localizations/src/nb-NO.tspackages/localizations/src/nl-BE.tspackages/localizations/src/nl-NL.tspackages/localizations/src/pl-PL.tspackages/localizations/src/pt-BR.tspackages/localizations/src/pt-PT.tspackages/localizations/src/ro-RO.tspackages/localizations/src/ru-RU.tspackages/localizations/src/sk-SK.tspackages/localizations/src/sr-RS.tspackages/localizations/src/sv-SE.tspackages/localizations/src/ta-IN.tspackages/localizations/src/te-IN.tspackages/localizations/src/th-TH.tspackages/localizations/src/tr-TR.tspackages/localizations/src/uk-UA.tspackages/localizations/src/vi-VN.tspackages/localizations/src/zh-CN.tspackages/localizations/src/zh-TW.tspackages/shared/src/types/elementIds.tspackages/shared/src/types/localization.tspackages/ui/src/components/ConfigureSSO/steps/ConfirmationStep.tsxpackages/ui/src/elements/Section.tsxpackages/ui/src/elements/Switch.tsxpackages/ui/src/elements/contexts/index.tsx
| interface SwitchProps { | ||
| id?: string; | ||
| isChecked?: boolean; | ||
| defaultChecked?: boolean; | ||
| onChange?: (checked: boolean) => void; | ||
| isDisabled?: boolean; | ||
| label: string | LocalizationKey; | ||
| label?: string | LocalizationKey; | ||
| 'aria-label'?: string; | ||
| 'aria-labelledby'?: string; | ||
| } |
There was a problem hiding this comment.
Require an accessible name when label is omitted.
Line 13 makes label optional, and Lines 115-127 skip visible text when absent. If neither aria-label nor aria-labelledby is provided (Lines 14-15, 72-73), the switch renders without an accessible name.
Suggested fix
interface SwitchProps {
id?: string;
isChecked?: boolean;
defaultChecked?: boolean;
onChange?: (checked: boolean) => void;
isDisabled?: boolean;
label?: string | LocalizationKey;
'aria-label'?: string;
'aria-labelledby'?: string;
}
export const Switch = forwardRef<HTMLDivElement, SwitchProps>(
(
@@
ref,
) => {
+ if (!label && !ariaLabel && !ariaLabelledBy) {
+ throw new Error('Switch requires one of: label, aria-label, or aria-labelledby.');
+ }
+
const [internalChecked, setInternalChecked] = useState(!!defaultChecked);
@@As per coding guidelines: Implement proper ARIA attributes for accessibility in React components.
Also applies to: 72-73, 115-127
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/ui/src/elements/Switch.tsx` around lines 7 - 16, The Switch
component currently allows omitting a visible label and also omits any aria
labeling, producing an unlabeled control; update the component to enforce an
accessible name by adding a runtime guard inside the Switch function (the
component that uses SwitchProps) that checks if props.label is falsy AND both
props['aria-label'] and props['aria-labelledby'] are falsy, and if so emit a
clear console.error (or throw) and return null (or throw) to prevent rendering
an unlabeled control; alternatively update SwitchProps to a discriminated/union
type that requires either label or one of 'aria-label'/'aria-labelledby' and add
the runtime assertion to cover JS consumers — reference SwitchProps,
props.label, props['aria-label'], props['aria-labelledby'], and the Switch
component render logic to locate where to add the check and error message.
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
3d00844 to
89f54e0
Compare
89f54e0 to
de76ddf
Compare
de76ddf to
28f5c19
Compare
28f5c19 to
c2402cf
Compare
c2402cf to
b16afe2
Compare
b16afe2 to
148a5a5
Compare
148a5a5 to
1d874c3
Compare
Description
Introduces confirmation step to surface connection information, also allowing to:
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change